package com.itheima.chapter09.io.charstream;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

//字符流写数据
public class OutputStreamWriterDemo {
    public static void main(String[] args) throws IOException {
        FileWriter fw =new FileWriter(new File("MyIdeaTest\\b.txt"));
        fw.write(97);
        fw.write(98);
        fw.write("\r\n");
        char[] ch ={97,98,99,100};
        fw.write(ch);
        fw.write("\r\n");
        fw.write(ch,0,3);
        fw.write("\r\n");
        String s = "我爱中国";
        fw.write(s);
        fw.write("\r\n");
        fw.write(s,1,2);
        fw.flush();
        fw.close();
    }
}
